﻿@model SCS.Common.Models.Teacher

@{
    Layout = null;
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.ui.datepicker-vi-VN.js")" type="text/javascript"></script>
<script>
$(function () {
    $.validator.addMethod('date',
    function (value, element) {
        if (this.optional(element)) {
            return true;
        }
        var ok = true;
        try {
            $.datepicker.parseDate('dd/mm/yy', value);
        }
        catch (err) {
            ok = false;
        }
        return ok;
    });
    $(".datefield").datepicker({ dateFormat: 'dd/mm/yy', yearRange: '1950:2020', changeYear: true, changeMonth: true });
});
</script>
<h2>Sửa thông tin giáo viên</h2>
@using (Html.BeginForm())
{  
    <fieldset>
        <legend>Giáo viên</legend>
        @Html.HiddenFor(model =>model.teacherID)
        <div class="editor-label">
            @Html.Label("Tên giáo viên")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.teacherName)
            @Html.ValidationMessageFor(model => model.teacherName)
        </div>
        <div class="editor-label">
            @Html.Label("Ngày sinh")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.dateOfBirth)
            <br />
            @Html.ValidationMessageFor(model => model.dateOfBirth)
        </div>
        <div class="editor-label">
            @Html.Label("Giới tính")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.gender, (IEnumerable<SelectListItem>)ViewBag.Genders, "--")
            @Html.ValidationMessageFor(model => model.gender)
        </div>

        <div class="editor-label">
            @Html.Label("Địa chỉ giáo viên")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.address)
            @Html.ValidationMessageFor(model => model.address)
        </div>

        <div class="editor-label">
            @Html.Label("Số điện thoại")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.mobile)
            @Html.ValidationMessageFor(model => model.mobile)
        </div>
        <div class="editor-label">
            @Html.Label("Trạng thái")
        </div>
        <div class="editor-field">
            @Html.RadioButtonFor(model => model.deactived, false) Biên chế
            @Html.RadioButtonFor(model => model.deactived, true, true) Nghỉ làm
            @Html.ValidationMessageFor(model => model.deactived)
        </div>
        <br />
        <div style="float: left">
            <button type="submit" id="btnUpdate" name="Command" value="Update" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
                <span class="ui-button-text">Cập nhật</span></button>
            &nbsp; &nbsp;
        </div>
    </fieldset>
}